package showgo.gui;

import java.util.List;

import javax.swing.JTable;

import showgo.modell.stueck.Rolle;

public class RollenTable extends JTable {

    /**
     * 
     */
    private static final long serialVersionUID = -7006952199598772830L;

    public RollenTable() {
	setModel(new RollenTableModel());
    }

    public void addRolle(Rolle rolle) {
	((RollenTableModel) getModel()).addRolle(rolle);
    }

    public List<Rolle> getRollen() {
	return ((RollenTableModel) getModel()).getRollen();
    }

    public void replaceRolle(Rolle oldRolle, Rolle newRolle) {
	((RollenTableModel) getModel()).replaceRolle(oldRolle, newRolle);
    }

    public Rolle getRolleAt(int rowIndex) {
	return ((RollenTableModel) getModel()).getRolleAt(rowIndex);
    }

    public void refresh() {
	((RollenTableModel) getModel()).fireTableDataChanged();
    }

    public boolean isEmpty() {
	return ((RollenTableModel) getModel()).isEmpty();
    }

    public void removeRolle(Rolle rolle) {
	((RollenTableModel) getModel()).removeRolle(rolle);
    }

    public Rolle removeRolleAt(int rowIndex) {
	return ((RollenTableModel) getModel()).removeRolleAt(rowIndex);
    }
}
